﻿@model IEnumerable<CSCSN.ViewModels.ApplicationTaskVM>

@{
    Layout = null;
    ViewData["Title"] = "搜索任务";


    // 提取控制器路径
    var controllerPath = "/" + ViewContext.RouteData.Values["controller"].ToString();

    // 新建或者编辑对象的路径
    var creatOrEditUrlString = controllerPath + "/CreateOrEdit/";
    // 根据关键词检索列表数据的路径
    var searchWithKeywordUrlString = controllerPath + "/List?keyword=";
    // 明细数据路径
    var detailUrlString = controllerPath + "/Detail/";
    // 删除数据路径
    var deleteUrlString = controllerPath + "/Delete/";
    // 缺省的列表页路径
    var defaultListUrlString = controllerPath + "/TaskQueryList/";
    // 用户添加任务路径
    var userAddTaskListUrlString = controllerPath + "/UserAddTask/";
    // 用户取消任务路径搜索结果
    var userCancelTaskListUrlString = controllerPath + "/UserCancelTask/";

    var pageGroup = ViewData["PageGroup"] as CSCSN.DataAccess.Tool.PagenateGroup;





}
<head>
    <style>
        .searchResult {
            height: 600px;
            width: 100%;
        }

    </style>
</head>
    <div class="searchResult">
        <table class="table">
            <thead>
                <tr>
                    <th>
                        序号
                    </th>
                    <th>
                        名称
                    </th>
                    <th>
                        地点
                    </th>
                    <th>
                        分值
                    </th>
                    <th>
                        开始时间
                    </th>
                    <th>
                        时长
                    </th>
                    <th>
                        发起人
                    </th>
                    <th>
                        描述
                    </th>
                    <th>
                        操作
                    </th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    if (item.IsSelected == true)
                    {
                        <tr>
                            <td>
                                @Html.DisplayFor(modelItem => item.OrderNumber)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Name)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.TaskSiteName)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Score)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.BeginTime)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Duration)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.IssuerName)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Description)
                            </td>

                            <td>
                                @{
                                    var deleteTip = "你即将取消<span style=\"font-size:18px\">" + item.Name + "</span> <br> 任务，请你确定";
                                    var action = "取消任务";
                                }
                                <a href="javascript:void(0)" onclick="appOpenUserAddTaskItemModalForS('@action','userAddTaskItemModal','@item.Id', '@deleteTip','@userCancelTaskListUrlString','@defaultListUrlString','mainWorkPlaceArea','@pageGroup.PageIndex')"><i>✖</i> </a>
                            </td>
                        </tr>
                    }
                    else
                    {
                        <tr>
                            <td>
                                @Html.DisplayFor(modelItem => item.OrderNumber)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Name)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.TaskSiteName)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Score)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.BeginTime)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Duration)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.IssuerName)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Description)
                            </td>

                            <td>
                                @{
                                    var deleteTip = "你正在执行接取<span style=\"font-size:18px\">" + item.Name + "</span> <br> 任务，请你确定";
                                    var action = "接取任务";
                                }
                                <a href="javascript:void(0)" onclick="appOpenUserAddTaskItemModalForS('@action','userAddTaskItemModal','@item.Id', '@deleteTip','@userAddTaskListUrlString','@defaultListUrlString','mainWorkPlaceArea','@pageGroup.PageIndex')"><i>✔</i> </a>
                            </td>
                        </tr>
                    }


                }
            </tbody>
        </table>
    </div>
    <div >
        <partial name="_PaginationPartialForTaskQuery" />
    </div>


